package com.hyopt.modules.app.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ApiChatGPTController
 * @Description 智能回复机器人
 * @Author lijie
 * @Date 2023/2/8 13:31 星期三
 * @Version 1.0
 */
@RestController
@RequestMapping("/api/chatGpt")
@Api(value="ApiChatGPTController",tags={"智能回复机器人"})
public class ApiChatGPTController {
    @Autowired
    ChatGPT chatGPT;
    @GetMapping("/ask")
    @ApiOperation("发起对话")
    public Object ask(@RequestParam(required = true) String content){
        Object o = chatGPT.chat(content);
        return o;
    }

}
